from django.contrib import admin

# Register your models here.
from myblog.models import Fenlei, Biaoqian, WenZ, Banner, Tui, Link


@admin.register(WenZ)
class WenZAdmin(admin.ModelAdmin):
    list_display = ('id', 'fenlei', 'title', 'tui', 'user', 'views', 'dianzan', 'created_time')
    #文章列表显示的字段
    list_per_page = 50
    #满50分页
    ordering = ('-created_time',)
    #排序方式
    list_display_links = ('id', 'created_time')
    #设置可进入编辑页面的字段

@admin.register(Banner)
class BannerAdmin(admin.ModelAdmin):
    list_display = ('id', 'text_info', 'img', 'link_url', 'is_active')

@admin.register(Fenlei)
class FenleiAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'index')

@admin.register(Biaoqian)
class BiaoqianAdmin(admin.ModelAdmin):
    list_display = ('id', 'name')

@admin.register(Tui)
class TuiAdmin(admin.ModelAdmin):
    list_display = ('id', 'name')

@admin.register(Link)
class LinkAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'linkurl')


admin.site.site_header = 'PythonTop管理系统'
admin.site.site_title = '登录系统后台'
admin.site.index_title = '后台管理'